﻿<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             x:Class="BlueMarble.Genesis.Shell.App"
             xmlns:InfrastructureControls="clr-namespace:BlueMarble.Genesis.Infrastructure.Controls;assembly=BlueMarble.Genesis.Infrastructure"
             xmlns:Primitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls">
    
    <Application.Resources>

        <Style x:Key="BlackBarTabPanelStyle" TargetType="Primitives:TabPanel">
            <Setter Property="Opacity" Value="0.6"/>
        </Style>

        <Style TargetType="InfrastructureControls:TabControl" x:Key="BlackBarTabControlResourceKey">
            <Setter Property="Foreground" Value="Black" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="InfrastructureControls:TabControl">
                        <Grid>
                            <Grid x:Name="TemplateTop" Visibility="Visible" Margin="0,0,0,8">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="48"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>

                                <Primitives:TabPanel x:Name="TabPanelTop" Margin="2,2,2,0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Canvas.ZIndex="1000" Style="{StaticResource BlackBarTabPanelStyle}">
                                    <Primitives:TabPanel.Background>
                                        <SolidColorBrush Color="Black" Opacity="0.6" />
                                    </Primitives:TabPanel.Background>
                                </Primitives:TabPanel>

                                <Border Grid.Row="1" Margin="2" x:Name="Border" Background="Transparent" BorderBrush="Black" CornerRadius="3">
                                    <ContentPresenter Margin="4" x:Name="SelectedContentHost" Content="{TemplateBinding SelectedContent}"/>
                                </Border>
                            </Grid>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="InfrastructureControls:TabItem" x:Key="BlackBarTabItemResourceKey">
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="Height" Value="36" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="InfrastructureControls:TabItem">
                        <Border Margin="0" x:Name="Border" Background="Transparent" BorderBrush="Black" BorderThickness="0" CornerRadius="4">
                            <Grid>
                                <ContentControl x:Name="HeaderTopUnselected" Cursor="{TemplateBinding Cursor}" FontSize="{TemplateBinding FontSize}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" IsTabStop="False" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalAlignment}" Foreground="WhiteSmoke" Background="Black" VerticalContentAlignment="Center"/>
                                <ContentControl x:Name="HeaderTopSelected" Cursor="{TemplateBinding Cursor}" FontSize="16" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" IsTabStop="False" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalAlignment}" Foreground="White" Background="Black" FontWeight="Bold" VerticalContentAlignment="Center"/>
                            </Grid>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </Application.Resources>
</Application>
